package com.example.demo.vo

import com.example.demo.dbmodels.TCareLabel
import java.time.LocalDateTime

class CareLabelVo {

    /**
     *  护理标签id
     **/
    var id: Int? = null

    /**
     *  标签分类
     **/
    var label_cat: String? = null

    /**
     *  标签名称
     **/
    var label_code: String? = null

    /**
     *  标签名称
     **/
    var label_name: String? = null

    /**
     *  标签类型
     **/
    var label_type: Int? = null

    /**
     *  背景颜色
     **/
    var bg_color: String? = null

    /**
     *  字体颜色
     **/
    var font_color: String? = null

    /**
     *  详细内容
     **/
    var detail_content: String? = null

    /**
     *  状态1=有效，0=无效
     **/
    var status: Int? = null

    /**
     *  备注
     **/
    var remark: String? = null

    /**
     *  排序
     **/
    var sort: Int? = null

    /**
     *  更新时间
     **/
    var update_time: String? = null

    /**
     *  更新人
     **/
    var update_by: Int? = null

    /**
     *  删除标记
     **/
    var is_del: Boolean? = null

    /**
     *  拼音首字母
     **/
    var py: String? = null


    fun getCareLabelVo(table:TCareLabel?): CareLabelVo?{
        table?.let {
            val data = CareLabelVo()
            data.bg_color = it.bg_color
            data.detail_content = it.detail_content
            data.font_color = it.font_color
            data.id = it.id
            data.is_del = it.is_del
            data.label_cat = it.label_cat
            data.label_code = it.label_code
            data.label_name = it.label_name
            data.label_type = it.label_type
            data.py = it.py
            data.remark = it.remark
            data.sort = it.sort
            data.status = it.status
            data.update_by = it.update_by
            data.update_time = it.update_time
            return  data
        }
        return null
    }

    fun getCareLabelVoList(table: List<TCareLabel>?): List<CareLabelVo>? {
        table?.let {
            val careLabelVoList = mutableListOf<CareLabelVo>()
            table.forEach {
                val data = CareLabelVo()
                data.bg_color = it.bg_color
                data.detail_content = it.detail_content
                data.font_color = it.font_color
                data.id = it.id
                data.is_del = it.is_del
                data.label_cat = it.label_cat
                data.label_code = it.label_code
                data.label_name = it.label_name
                data.label_type = it.label_type
                data.py = it.py
                data.remark = it.remark
                data.sort = it.sort
                data.status = it.status
                data.update_by = it.update_by
                data.update_time = it.update_time
                careLabelVoList.add(data)
            }
            return careLabelVoList
        }
        return null
    }


}